class UserStateStorage {
  KEY_SDK_MODAL = "KEY_SDK_MODAL";

  KEY_AGE_MODAL = "KEY_AGE_MODAL";

  constructor() {}

  setSdkModalState(value = false) {
    uni.setStorageSync(this.KEY_SDK_MODAL, value);
  }

  getSdkModalState() {
    return uni.getStorageSync(this.KEY_SDK_MODAL) || false;
  }

  setAgeModalState(value = false) {
    uni.setStorageSync(this.KEY_AGE_MODAL, value);
  }

  getAgeModalState() {
    // 确认SDK弹框先
    if (this.getSdkModalState()) {
      return uni.getStorageSync(this.KEY_AGE_MODAL) || false;
    }
    this.setSdkModalState(false);
    return false;
  }
}

export default new UserStateStorage();
